package observer

interface Observer<T> {

    /**
     * 接收到通知
     */
    fun update(msg: T)

    /**
     * 订阅
     */
    fun subscription(observable: Observable<T>): Observer<T>

    /**
     * 取消订阅
     */
    fun unSubscription(observable: Observable<T>)

    /**
     * 接受到消息的回调
     */
    fun onReceived(onReceive: OnReceive<T>)
}